﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WindowsFormsApp2

{
    class Helper
    {
        private static readonly string connectionString = "Data Source =. ; Initial Catalog =bbtest; Integrate Security = True";

        public static DataTable GetDataTable(string cmdString)
        {
            SqlConnection sqlConnection = new SqlConnection(connectionString);
            SqlDataAdapter dataAdapter = new SqlDataAdapter(cmdString, connectionString);
            DataTable table = new DataTable();
            dataAdapter.Fill(table);
            return table;
        }

    }
}
